{% extends "baseD.html" %}

{% block headtitle %}- Contact{% endblock %}

{% block css %} {% endblock %}

{% block scripts %}
<script type="text/javascript">
    var EmailExp = /[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+(?:[A-Z]{2}|com|org|net|gov|mil|biz|info|mobi|name|aero|jobs|museum)\b/ //'
    
    function validateForm() {
		for ( i = 0; i < 3; i++ ) {
		    box = document.contactForm.elements[i];
		    if ( !box.value) {
				alert('You haven\'t filled in ' + box.name + '!');
				box.focus();
				return false;
		    }
		    if ( i == 1 ) {
		       addr = box.value;
		       if ( !EmailExp.test(addr) ) {
					alert("The email address you entered is invalid");
					box.focus();
					return false;
				}
		    }
		}

		alert("Thank you for contacting us. We will be getting back to you shortly.");
		return true;
    }

    // Attempt to thwart simple spam bots by posting how long the form has been open
    // and then checking on the server side
    var spamTimer = 0;
    function antiSpam() {
    	spamTimer++;
    	document.getElementById("anti_spam").value = spamTimer;
        setTimeout("antiSpam()", 1000);
    }
</script>
{% endblock %}

{% block onload %} {% endblock %}

{% block divtitle %}- Contact{% endblock %}

{% block content %}
    <div id="centercontent">
    	<span class="title">Contact Us</span>

		<div>
		    <p class="text">Thank you for visiting our site.<br/>
		    	Please fill in the form below in order to contact us. All fields are mandatory.
			</p>                
		    <div id="forms">
				<form name="contactForm" onsubmit="return validateForm();" action="/sendMail/" method="post"> 
					Your name: <input type="text" id="form_text" name="Name" /><br /><br />
					Your e-mail: <input type="text" name="Email" id="form_text"><br /><br />
					Your message: <br /><textarea name="Message" id="form_textarea"></textarea><br /><br />
					<input type="hidden" name="anti_spam" id="anti_spam" value="dont spam me bro" />
					<input type="submit" value="Send" id="submitbutton">
					<input type="reset" value="Reset" id="submitbutton">
				</form>
		    </div><!-- end forms1 -->
		</div><!-- end text -->  
    </div><!-- end contentpage --> 
	<script type="text/javascript">antiSpam();</script>
{% endblock %}

{% block scripts2 %} {% endblock %}